package com.mj.common.sdk.api;

import java.util.Map;

import com.mj.common.config.AppConfig;
import com.mj.common.sdk.tools.HttpUtil;
import com.mj.common.sdk.tools.ParaMap;

/**
 * 获取全局access_token
 *  @author zhouping
 */
public class AccessTokenClient extends AbstractClient {


   

    @Override
	public AccessToken getAccessToken() {
        final String appId = apiConfig.getAppId();
        final String appSecret = apiConfig.getAppSecret();
        Map<String, String> queryParas = ParaMap.create("appid", appId).put("secret", appSecret).getData();
        String json = HttpUtil.get(AppConfig.WEI_XIN_TOKEN, queryParas);
        return new AccessToken(json);
    }

}
